<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

	<script type="text/javascript">
		//用户列表
		function list() {
			let xhr = new XMLHttpRequest()

			xhr.open("get", "http://wish.byesame.com/admin?page=2&rows=10")
			//从本地存储里拿数据 localStorage.getItem("属性名")
			//token 令牌 用户登录之后，后端会返回一串token，登陆后的操作都依据token,token存在且没过期才能继续操作
			xhr.setRequestHeader("token", localStorage.getItem("token"))
			xhr.send()
			xhr.onreadystatechange = function() {
				if (xhr.readyState == 4) {
					let res = JSON.parse(xhr.responseText)
					console.log(res)
				}
			}
		}
		list()
	</script>
</body>
</html>